package config

import (
	k8sclient "k8s_gui_client/k8s/client"
)

//secret list
func GetSecrets(namespace string) (map[string]interface{}, error) {

	if namespace != "" {
		return k8sclient.CurrentK8sApiClient.GetAPI("/api/v1/namespaces/" + namespace + "/secrets")
	} else {
		return k8sclient.CurrentK8sApiClient.GetAPI("/api/v1/secrets")

	}

}

func SecretURL(namespace string, name string) string {
	return "/api/v1/namespaces/" + namespace + "/secrets/" + name
}

func GetSecretYaml(namespace string,name string) (string ,error){
    return k8sclient.CurrentK8sApiClient.GetAPIAsYaml(SecretURL(namespace,name))
}